package com.zerui.manager.app.accessauthdevice;

import com.zerui.cola.dto.PageResponse;
import com.zerui.cola.dto.Response;
import com.zerui.manager.app.accessauthdevice.executer.AccessAuthDeviceAddCmdExe;
import com.zerui.manager.app.accessauthdevice.executer.AccessAuthDeviceDelCmdExe;
import com.zerui.manager.app.accessauthdevice.executer.AccessAuthDeviceQryCmdExe;
import com.zerui.manager.app.accessauthdevice.executer.AccessAuthDeviceSyncCmdExe;
import com.zerui.manager.web.AccessAuthDeviceService;
import com.zerui.manager.web.cmd.AccessAuthDeviceBindCmd;
import com.zerui.manager.web.cmd.AccessAuthDeviceQryCmd;
import com.zerui.manager.web.vo.AccessAuthDevicePageVO;
import com.zerui.manager.web.vo.AccessAuthDeviceVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;


/**
 * @Author wh
 * @create_time 2023-08-23 11:08
 */
@Service
public class AccessAuthDeviceServiceImpl implements AccessAuthDeviceService {

	@Resource
	private AccessAuthDeviceQryCmdExe accessAuthDeviceQryCmdExe;
	@Resource
	private AccessAuthDeviceAddCmdExe accessAuthDeviceAddCmdExe;
	@Resource
	private AccessAuthDeviceDelCmdExe accessAuthDeviceDelCmdExe;
	@Resource
	private AccessAuthDeviceSyncCmdExe accessAuthDeviceSyncCmdExe;

	@Override
	public PageResponse<AccessAuthDevicePageVO> getPageList(AccessAuthDeviceQryCmd accessAuthDeviceQryCmd) {
		return accessAuthDeviceQryCmdExe.execute(accessAuthDeviceQryCmd);
	}

	@Override
	public Response add(AccessAuthDeviceBindCmd accessAuthDeviceBindCmd) {
		return accessAuthDeviceAddCmdExe.execute(accessAuthDeviceBindCmd);
	}

	@Override
	public Response delete(AccessAuthDeviceBindCmd accessAuthDeviceBindCmd) {
		return accessAuthDeviceDelCmdExe.execute(accessAuthDeviceBindCmd);
	}

	@Override
	public Response sync() {
		return accessAuthDeviceSyncCmdExe.execute();
	}

	@Override
	public void deleteDeviceById(Long deviceId) {
		accessAuthDeviceDelCmdExe.executeDel(deviceId);
	}

	@Override
	public AccessAuthDeviceVO selectByDeviceId(Long deviceId) {
		return accessAuthDeviceQryCmdExe.selectByDeviceId(deviceId);
	}

    @Override
    public List<AccessAuthDeviceVO> selectByDeviceIds(Set<Long> deviceIds) {
        return accessAuthDeviceQryCmdExe.selectByDeviceIds(deviceIds);
    }

}
